<div id="login-form">

<?php if ($session->read("Account.logged") == "YES") { ?>
<p>Xin chào <?php echo $html->link($teefan->displayContent($session->read("Account.name")), "/accounts/show/".$session->read("Account.permalink")); ?> | <?php echo $html->link("Đăng xuất", array("controller" => "accounts", "action" => "logout")); ?></p>
<?php } else { ?>
<?php echo $ajax->form(array('type' => 'post', 'options' => array( 'model'=>'Account', 'update'=>'login-form', 'before' => 'Element.show("login-loader");Form.disable("login-button");', 'complete' => 'Element.hide("login-loader");Form.enable("login-button");', 'url' => array("controller" => "accounts", "action" => "login"))));?>
<ul>
  <h2>Thành Viên</h2>
<li>
  <div class="group">
  <?php echo $form->input("Account.email_login", array("class" => "text medium", "label" => array("class" => "desc", "text" => "Địa chỉ hộp thư"))); ?>
  <?php if (!empty($email_error)) { ?>
  <p class="error"><?php echo $email_error; ?></p>
  <?php } ?>
  <?php echo $form->input("Account.password_login", array("type" => "password", "class" => "password medium", "label" => array("class" => "desc", "text" => "Mật mã"))); ?>
  <?php if (!empty($password_error)) { ?>
  <p class="error"><?php echo $password_error; ?></p>
  <?php } ?>
  <label class="desc"></label>
  <?php echo $form->button("Đăng nhập", array("id" => "login-button", "class" => "button", "type" => "submit", "style" => "width:100px;")); ?> <?php echo $html->link("Đăng ký", array("controller" => "accounts", "action" => "register")) ?>
  <?php echo $html->image("ajax-loader.gif", array("id" => "login-loader", "style" => "display:none;")); ?>
  </div>
</li>
</ul>

<?php echo $form->end(); ?>
<?php } ?>

</div>